{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# YandexGPT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%pip install llama-index-embeddings-yandexgpt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install llama-index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from llama_index.embeddings.yandexgpt import YandexGPTEmbedding\n",
    "\n",
    "yandexgpt_embedding = YandexGPTEmbedding(\n",
    "    api_key=\"your-api-key\", folder_id=\"your-folder-id\"\n",
    ")\n",
    "\n",
    "text_embedding = yandexgpt_embedding._get_text_embeddings(\n",
    "    [\"This is a passage!\", \"This is another passage\"]\n",
    ")\n",
    "print(text_embedding)\n",
    "\n",
    "query_embedding = yandexgpt_embedding._get_query_embedding(\"Where is blue?\")\n",
    "print(query_embedding)"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
